package com.tamtoucan.tameablecreepers;

import net.minecraftforge.common.MinecraftForge;

import com.tamtoucan.tameablecreepers.client.SoundHandler;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler; // used in 1.6.2
//import cpw.mods.fml.common.Mod.PreInit;    // used in 1.5.2
//import cpw.mods.fml.common.Mod.Init;       // used in 1.5.2
//import cpw.mods.fml.common.Mod.PostInit;   // used in 1.5.2
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;

@Mod(modid=ModConstants.MOD_ID, name=ModConstants.MOD_NAME, version=ModConstants.VERSION_STRING)
public class FriendlyCreeperMod {

        // The instance of your mod that Forge uses.
        @Instance(value = ModConstants.MOD_ID)
        public static FriendlyCreeperMod instance;
        
        public static org.apache.logging.log4j.Logger logger;
        
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide=ModConstants.CLIENT_PROXY_CLASS, serverSide=ModConstants.SERVER_PROXY_CLASS)
        public static CommonProxy proxy;
       
        @EventHandler // used in 1.6.2
        //@PreInit    // used in 1.5.2
        public void preInit(FMLPreInitializationEvent event) {
            	logger = event.getModLog();
        }
       
        @EventHandler // used in 1.6.2
        //@Init       // used in 1.5.2
        public void load(FMLInitializationEvent event) {
        	proxy.registerRenderers();
        	EntityRegistry.registerGlobalEntityID(EntityTameableCreeper.class, "TameableCreeper", EntityRegistry.findGlobalUniqueEntityId(), 6750105, 7859797);
        	EntityRegistry.registerModEntity(EntityTameableCreeper.class, "TameableCreeper", 3, this, 64, 3, true);
        	MinecraftForge.EVENT_BUS.register(new EntityInteractHandler());
        	MinecraftForge.EVENT_BUS.register(new SoundHandler()); 
        }
            
        @EventHandler
        public void modsLoaded(FMLPostInitializationEvent event) {
        }
       
        @EventHandler // used in 1.6.2
        //@PostInit   // used in 1.5.2
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
}